package com.example.demo041.controller;

import com.example.demo041.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping(value = "/toName", method = RequestMethod.GET)
    public String toName(Map<String, Object> map){
        String name = userService.getName(3);
        map.put("name", name);
        return "error";
    }
}
